import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/project_same_time_entity.dart';

ProjectSameTimeEntity $ProjectSameTimeEntityFromJson(Map<String, dynamic> json) {
  final ProjectSameTimeEntity projectSameTimeEntity = ProjectSameTimeEntity();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    projectSameTimeEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    projectSameTimeEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    projectSameTimeEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    projectSameTimeEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    projectSameTimeEntity.deleted = deleted;
  }
  final List<String>? fileList = (json['fileList'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (fileList != null) {
    projectSameTimeEntity.fileList = fileList;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    projectSameTimeEntity.id = id;
  }
  final String? ledgerFileUrl = jsonConvert.convert<String>(json['ledgerFileUrl']);
  if (ledgerFileUrl != null) {
    projectSameTimeEntity.ledgerFileUrl = ledgerFileUrl;
  }
  final String? projectBeginDate = jsonConvert.convert<String>(json['projectBeginDate']);
  if (projectBeginDate != null) {
    projectSameTimeEntity.projectBeginDate = projectBeginDate;
  }
  final String? projectEndDate = jsonConvert.convert<String>(json['projectEndDate']);
  if (projectEndDate != null) {
    projectSameTimeEntity.projectEndDate = projectEndDate;
  }
  final String? projectName = jsonConvert.convert<String>(json['projectName']);
  if (projectName != null) {
    projectSameTimeEntity.projectName = projectName;
  }
  final String? projectNowBeginDate = jsonConvert.convert<String>(json['projectNowBeginDate']);
  if (projectNowBeginDate != null) {
    projectSameTimeEntity.projectNowBeginDate = projectNowBeginDate;
  }
  final String? projectNowEndDate = jsonConvert.convert<String>(json['projectNowEndDate']);
  if (projectNowEndDate != null) {
    projectSameTimeEntity.projectNowEndDate = projectNowEndDate;
  }
  final String? projectNowStatus = jsonConvert.convert<String>(json['projectNowStatus']);
  if (projectNowStatus != null) {
    projectSameTimeEntity.projectNowStatus = projectNowStatus;
  }
  final String? projectNowStatusName = jsonConvert.convert<String>(json['projectNowStatusName']);
  if (projectNowStatusName != null) {
    projectSameTimeEntity.projectNowStatusName = projectNowStatusName;
  }
  final String? projectType = jsonConvert.convert<String>(json['projectType']);
  if (projectType != null) {
    projectSameTimeEntity.projectType = projectType;
  }
  final String? projectTypeName = jsonConvert.convert<String>(json['projectTypeName']);
  if (projectTypeName != null) {
    projectSameTimeEntity.projectTypeName = projectTypeName;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    projectSameTimeEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    projectSameTimeEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    projectSameTimeEntity.updateDate = updateDate;
  }
  final String? statusName = jsonConvert.convert<String>(json['statusName']);
  if (statusName != null) {
    projectSameTimeEntity.statusName = statusName;
  }
  return projectSameTimeEntity;
}

Map<String, dynamic> $ProjectSameTimeEntityToJson(ProjectSameTimeEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['fileList'] = entity.fileList;
  data['id'] = entity.id;
  data['ledgerFileUrl'] = entity.ledgerFileUrl;
  data['projectBeginDate'] = entity.projectBeginDate;
  data['projectEndDate'] = entity.projectEndDate;
  data['projectName'] = entity.projectName;
  data['projectNowBeginDate'] = entity.projectNowBeginDate;
  data['projectNowEndDate'] = entity.projectNowEndDate;
  data['projectNowStatus'] = entity.projectNowStatus;
  data['projectNowStatusName'] = entity.projectNowStatusName;
  data['projectType'] = entity.projectType;
  data['projectTypeName'] = entity.projectTypeName;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['statusName'] = entity.statusName;
  return data;
}

extension ProjectSameTimeEntityExtension on ProjectSameTimeEntity {
  ProjectSameTimeEntity copyWith({
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    List<String>? fileList,
    String? id,
    String? ledgerFileUrl,
    String? projectBeginDate,
    String? projectEndDate,
    String? projectName,
    String? projectNowBeginDate,
    String? projectNowEndDate,
    String? projectNowStatus,
    String? projectNowStatusName,
    String? projectType,
    String? projectTypeName,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? statusName,
  }) {
    return ProjectSameTimeEntity()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..fileList = fileList ?? this.fileList
      ..id = id ?? this.id
      ..ledgerFileUrl = ledgerFileUrl ?? this.ledgerFileUrl
      ..projectBeginDate = projectBeginDate ?? this.projectBeginDate
      ..projectEndDate = projectEndDate ?? this.projectEndDate
      ..projectName = projectName ?? this.projectName
      ..projectNowBeginDate = projectNowBeginDate ?? this.projectNowBeginDate
      ..projectNowEndDate = projectNowEndDate ?? this.projectNowEndDate
      ..projectNowStatus = projectNowStatus ?? this.projectNowStatus
      ..projectNowStatusName = projectNowStatusName ?? this.projectNowStatusName
      ..projectType = projectType ?? this.projectType
      ..projectTypeName = projectTypeName ?? this.projectTypeName
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..statusName = statusName ?? this.statusName;
  }
}
